package com.example.ch08.Service.Imp;

import com.example.ch08.Entity.User;
import com.example.ch08.Mapper.UserMapper;
import com.example.ch08.Service.UserService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImp implements UserService {
    @Resource
    private UserMapper userMapper;

    @Cacheable(value={"id"}, key="#id", condition="true " )
    @Override
    public List<User> finAll(int id) {
        return userMapper.finAll();
    }
}
